<template>
    <div class="boy">
        <h3>男人组件</h3>
        <div>金钱：{{ $store.state.money }}</div>
        <button @click="addMbMoney">搬砖+1</button>
        <button @click="addMoney(1000)">卖肾+100</button>
    </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
    methods: {
        ...mapMutations(['addMbMoney', 'addMoney']),



        // add() {
        //     this.$store.commit('addMbMoney')
        // },
        // addMoney() {
        //     this.$store.commit('addMoney', 1000)
        // },

    }
}
</script>

<style>
button {
    padding: 5px;
    line-height: 30px;
    margin-left: 10px;
}
</style>
